﻿using Hrm.Core;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hrm.EntityFramework
{
    public class PermissionContext : BaseDbContext
    {

        #region Properties
        public DbSet<Application> Applications { get; set; }

        public DbSet<Role> Roles { get; set; }

        public DbSet<User> Users { get; set; }

        public DbSet<Resource> Resources { get; set; }

        public DbSet<Dictionary> Dictionarys { get; set; }

        public DbSet<ResourceAndPermission> ResourceAndPermissions { get; set; }

        public DbSet<Permission> Permissions { get; set; }

        #endregion

        #region Ctor

        public PermissionContext()
            : base("name=PermissionDbConnectionStrings")
        {
        }

        public PermissionContext(string nameOrConnectionString)
            : base(nameOrConnectionString)
        {
        }

        #endregion

        #region Utilities

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
        }

        #endregion
    }
}
